<?php
	class Login_model extends Model
	{
		function Login_model()
		{
		parent::Model();
		
		}
		function checkLogin($login_info = array())
		{
			$query_txt = "select * from admin_users where username = ? and admin_pwd = ? ";
			$query = $this->db->query($query_txt,$login_info);
			if($query->num_rows()>0)
			{
				$result = $query->row_array();
				$sessionArray = array('uid'=>$result['adminid'],
				'usrname'=>$result['username'],
				'logged'=>TRUE);
				$this->session->set_userdata($sessionArray);		
		        return $result['adminid'];	
				//$this->session->set_userdata('vuserid',$userid);
				//$userid = 1;
			}
		}
	}
?>